package com.ciei.dpagm.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ciei.dpagm.common.service.BaseService;
import com.ciei.dpagm.entity.ChipClockParameter;
import com.ciei.dpagm.mapper.ChipClockParameterMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangyan
 * @date 2023/05/08
 */
@Service
public class ChipClockParameterService extends BaseService<ChipClockParameterMapper, ChipClockParameter> {

    /**
     * 根据芯片IDS获取时钟参数列表
     * @param chipIds
     * @return
     */
    public List<ChipClockParameter> getListByChipIds(List<Integer> chipIds){
        if (chipIds.isEmpty()){
            return new ArrayList<>();
        }
        QueryWrapper<ChipClockParameter> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().in(ChipClockParameter::getChipId,chipIds);
        return list(queryWrapper);
    }

}
